UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tn2asu4AacBAgkg4ftzTOZ4qLg/0ozIIDg0scJBaMp4=' 
WHERE 
  key_id = '4b939a4128e9961bcf91c273294b7676956612d03541cf880ee8bda71971b83e' 
  AND (
    token = 'tn2asu4AacBAgkg4ftzTOZ4qLg/0ozIIDg0scJBaMp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041