UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Enh3bQZWGHhyQ7kBfU8u5Ku9FibhBEdHFRi9fljiXGo='
WHERE
key_id = 'ea0fc65305562a33552a6b9a85a3d9176c14a5d1ac4437112e8be1d14e6d96a0'
AND (
token = 'Enh3bQZWGHhyQ7kBfU8u5Ku9FibhBEdHFRi9fljiXGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)