UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BYh/vbfF8frhFW84njryN1rrOVtzcPbtgp7f5hpj0Bc='
WHERE
key_id = '05fd4ef2ba62c3e71873d37a4bb15004b10a25fe39be9544bdeb9f0961ec6d28'
AND (
token = 'BYh/vbfF8frhFW84njryN1rrOVtzcPbtgp7f5hpj0Bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)