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

Query time 0.00032