UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8gMAKyAVcDX7OQvpWFmYgFNJ0WB6FCNspsoGGcRQPLY='
WHERE
key_id = '3268b42b7f81f3c54dc2a82009d54e1f51bb331c2e120b5f11bd57df58a6918a'
AND (
token = '8gMAKyAVcDX7OQvpWFmYgFNJ0WB6FCNspsoGGcRQPLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)