UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eohrbL9TXml3/ecvSLSwqQH/cB5P3cb49CUIEBgAPhE='
WHERE
key_id = 'e58e681284aae2e9c76551174f3209656a021114bd0472c1b101952a3048919f'
AND (
token = 'eohrbL9TXml3/ecvSLSwqQH/cB5P3cb49CUIEBgAPhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)