UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dIjCPKtEcbL052XIn/rE2LqqzyYpBJTWleYXyVu5kzc='
WHERE
key_id = '2f47826a065ca63b911214573c9b375c6bf8083c4007dd8ef955494e41995579'
AND (
token = 'dIjCPKtEcbL052XIn/rE2LqqzyYpBJTWleYXyVu5kzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)