UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xxp+ehQoYv2LQOS3RzUU/URGyPNHuSyjNCpF9YeZfN0=' 
WHERE 
  key_id = '93dfabd132a2857a1d0b034dd03ce5cedc0cda1a315828b14dd7206a9a3237f5' 
  AND (
    token = 'Xxp+ehQoYv2LQOS3RzUU/URGyPNHuSyjNCpF9YeZfN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029