UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kp19HdcBH6wzc/nhQ70KqRgTNrwtKNRtt8UFxSImkvo=' 
WHERE 
  key_id = '32b226ab0683f18928405bbae9e8c8c62218764e6e6c18a23ed83a2a0b3ce27a' 
  AND (
    token = 'kp19HdcBH6wzc/nhQ70KqRgTNrwtKNRtt8UFxSImkvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040