UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIlbM/Qan0tDaEa0XJweuWmUwV625wjLRvwCNJoQYLE=' 
WHERE 
  key_id = 'db7cb9deb0999000148f24a766d32293b04902baccc4f8e2d2811d62a8b272c4' 
  AND (
    token = 'EIlbM/Qan0tDaEa0XJweuWmUwV625wjLRvwCNJoQYLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020