UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TbKprxNz3l/FMPguYa6tU8MQZk9xuYP4sXU0ZE6RFko=' 
WHERE 
  key_id = '27424caf5d7a0b5650145cfb236df517686b806c79a0ebd5326f6bedd32301b8' 
  AND (
    token = 'TbKprxNz3l/FMPguYa6tU8MQZk9xuYP4sXU0ZE6RFko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046