UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hxIqXt7/qmwasOhMjmn+44UJ3QeZB0HFNcpzuh10dA0=' 
WHERE 
  key_id = '5c0606e31d8a59af8642f2fed7c80048329fba3753469da4c84e27a369105c03' 
  AND (
    token = 'hxIqXt7/qmwasOhMjmn+44UJ3QeZB0HFNcpzuh10dA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020