UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WQEdQSjkqgjARD1HIbbzRbqlb5pRtyl4PkVB0EttvOU=' 
WHERE 
  key_id = 'eb06746425e0b70afec7d2d92b53dcd0acef37bb13785c8e1a237e550d53e1ae' 
  AND (
    token = 'WQEdQSjkqgjARD1HIbbzRbqlb5pRtyl4PkVB0EttvOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019