UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bu/m62ak3aodpfFzwDyS4J4axnxmYUb+CCyC5TNLeDI='
WHERE
key_id = '2b32095e94900f14a01ab435fc9c7b557710adcffe36923f3bb3b73187c632c7'
AND (
token = 'Bu/m62ak3aodpfFzwDyS4J4axnxmYUb+CCyC5TNLeDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)