UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yvd4yxMYwjiakKulIeFTR+wuOs9E55AZWcwFb/7dEuQ=' 
WHERE 
  key_id = '9c5b3444b5c23ee047658fd9b06dbba6b4f128465b6478ddb8b38383b028c5b5' 
  AND (
    token = 'yvd4yxMYwjiakKulIeFTR+wuOs9E55AZWcwFb/7dEuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086