UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KoTXNRIzu6g8iEKb0uj5BE3WTYSWkCTrGI4JMSYN8aQ=' 
WHERE 
  key_id = '11d17a3d68c22657d6253ede907d19f1a4838a07bd3738cb14c511769569a1e7' 
  AND (
    token = 'KoTXNRIzu6g8iEKb0uj5BE3WTYSWkCTrGI4JMSYN8aQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024