UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ppRotAGW26zfXfdzCqOcuvXClbxCJKuSVY4asjcWgRA=' 
WHERE 
  key_id = '2f2f8bd71a5f90d773e2c8c7a39be34175f81ce68af597267cd4dc910c4e5ada' 
  AND (
    token = 'ppRotAGW26zfXfdzCqOcuvXClbxCJKuSVY4asjcWgRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036