UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uwp2sm/qEcLP0qdijTCAh9ridhQZQQA6Y8UPEpY4zw0=' 
WHERE 
  key_id = 'aff6191cf7737e284cf0d28d8519a0667a74c2aac7247c9da1b600f02f4d1b92' 
  AND (
    token = 'Uwp2sm/qEcLP0qdijTCAh9ridhQZQQA6Y8UPEpY4zw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020