UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fIq5snerBZj/HrRzxzPMpBfV42nS9Hlv9lkLBI0zNjc='
WHERE
key_id = '3cab82c534929c6bd32da6283c54df191c51fd378dc1fa1ce0f7d7237e783fc3'
AND (
token = 'fIq5snerBZj/HrRzxzPMpBfV42nS9Hlv9lkLBI0zNjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)