UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tPl4lY7c1OdQDoqkY4xyaOnXKNquJ4XVDUVKGsZtzs='
WHERE
key_id = 'bcdbda1ce8b548796795d0ee5ccad057f79d3e8e9903777b5d4350296c82cfe4'
AND (
token = '8tPl4lY7c1OdQDoqkY4xyaOnXKNquJ4XVDUVKGsZtzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)