UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WZUk01siKgXoYjULys2VACJKRyr40a0gWhC4pIu+zsU=' 
WHERE 
  key_id = '202b6d03a6c37d6540f267047d2e9803ef2dc345bcda0d933cdee4c763e608fa' 
  AND (
    token = 'WZUk01siKgXoYjULys2VACJKRyr40a0gWhC4pIu+zsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032