UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3cpCsfSjdAfT55WdASWuijGRuEI8ZfryFIs7JT/WPrM='
WHERE
key_id = 'fb456f6ae98a03a7a4054f641e3a10dd1fe60362114049c757f7a354b3840348'
AND (
token = '3cpCsfSjdAfT55WdASWuijGRuEI8ZfryFIs7JT/WPrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)