UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UE5atsxU8UU2vfVFtXFpguCxOolvO5a/4NuIZavNQo8=' 
WHERE 
  key_id = '27325105b6816d458c66f789bba501377afc69dd7ad0939af168ff4e5b7205c0' 
  AND (
    token = 'UE5atsxU8UU2vfVFtXFpguCxOolvO5a/4NuIZavNQo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031