UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fxqm/UEmxi2b+zwt0VrMTFHa6SbbnEacqGdhzqLjAIE=' 
WHERE 
  key_id = 'd1ef87e3e88c52c09b61df461b1f8081284830f3dccd0ff5cdf2ba824db5b604' 
  AND (
    token = 'fxqm/UEmxi2b+zwt0VrMTFHa6SbbnEacqGdhzqLjAIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023