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

Query time 0.00029