UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7CKyK94UGSKBsPmhnHkuPEoMG2KNEmJ6q+3dUClYG5M=' 
WHERE 
  key_id = '80519280a73071b34c6f0de71f1d231c3baa3a2bbea48410c61fb93a8ca0e194' 
  AND (
    token = '7CKyK94UGSKBsPmhnHkuPEoMG2KNEmJ6q+3dUClYG5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035