UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ctcZLPiW3Pgojrkkrdn8vMI3RvGRBDYFkSSyKJprS/U=' 
WHERE 
  key_id = '8ac0501be1ccc4e2e0bc87ea67612c8bf4e3f3a6b3654398ecf97a13a0621cd6' 
  AND (
    token = 'ctcZLPiW3Pgojrkkrdn8vMI3RvGRBDYFkSSyKJprS/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026