UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UjM7WgD30icZj44YQcdLFXzuM8y/gqE3yQlheESxvsA='
WHERE
key_id = 'db281853ccbbc7c1ecd0e90dbc1044d9a6cd2cb6c9dcf35124aa73424415a4b0'
AND (
token = 'UjM7WgD30icZj44YQcdLFXzuM8y/gqE3yQlheESxvsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)