UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PEb3ax1+qz+KOQPcqDb1B3Ib1CxHHwn+GRnpjXaFTEA='
WHERE
key_id = '7a64c5f0d0bbdfa33b243e23eae58dc19889c6128ec8836b362077d4701b88b2'
AND (
token = 'PEb3ax1+qz+KOQPcqDb1B3Ib1CxHHwn+GRnpjXaFTEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)