UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7NG3fOhjqXcvrnYFhttZXFzHPcwwPZ5qmssWYV1oqSM=' 
WHERE 
  key_id = '30c3ba6e36e1caa4f5d31e5b4904a503db54ae41b038814f7c8c114ea2f64bb8' 
  AND (
    token = '7NG3fOhjqXcvrnYFhttZXFzHPcwwPZ5qmssWYV1oqSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044