UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/lHACJI/ISwx4dJIsRDfYNhN8eZwmSvt0l/jgMm+XsA=' 
WHERE 
  key_id = '6d0f7c5e15aebffcb448ba5c6589c66b51eaa32d60ad212eb97470970bfb81c9' 
  AND (
    token = '/lHACJI/ISwx4dJIsRDfYNhN8eZwmSvt0l/jgMm+XsA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00089