UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VyAuXhThKOjZ/JLW78Xw6HB7iqwdn+op0TsBjFDo48s=' 
WHERE 
  key_id = '2140f1a5da197e83ee9d0d9868659f14d14028a7d11b05ed3d841e3e3d14336e' 
  AND (
    token = 'VyAuXhThKOjZ/JLW78Xw6HB7iqwdn+op0TsBjFDo48s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049