UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'maaEmQStPT4UUzK24zLHV+g2c7GkYkI3Z3hj3lv5UAQ=' 
WHERE 
  key_id = 'a857d6958237d5c6ca74076d501587c25b7f746961f13b2ade76f7fa9ae1a78b' 
  AND (
    token = 'maaEmQStPT4UUzK24zLHV+g2c7GkYkI3Z3hj3lv5UAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016