UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FXONq+mKVxcDGFrHjLh2IDFW3CUvWiamgSqZxc00CKc=' 
WHERE 
  key_id = 'ed97ecddc2031f9a52139c92ee3984aebe2943bd9329ce5156bc33ef779c0c42' 
  AND (
    token = 'FXONq+mKVxcDGFrHjLh2IDFW3CUvWiamgSqZxc00CKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030