UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rzqi9jhOlFFSA3KQsbc1CJm2kAa7j+mL1ZRFT7GN8wI='
WHERE
key_id = 'c17ea2856d4f0b7885f399e134d25d8bba15bbf9befee3bdad575d49d085c947'
AND (
token = 'Rzqi9jhOlFFSA3KQsbc1CJm2kAa7j+mL1ZRFT7GN8wI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)