UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+5Sk/BU/YJkot08gRzE8khrVKsLMlXcMoRk9NUMiAkA='
WHERE
key_id = 'a3aac0ab669b331669c779d13c9017e7d39fd846e15a18f2c03e4ca2b9dc0219'
AND (
token = '+5Sk/BU/YJkot08gRzE8khrVKsLMlXcMoRk9NUMiAkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)