UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BoCL6OZpiBmur/A6HlB3vmWy6uv9VjlC9TmLWTt1ffA='
WHERE
key_id = '14c8b2a2a985019c87a25ee4e31f42d9ca79cd57a3c311fbb6d74767c1d26702'
AND (
token = 'BoCL6OZpiBmur/A6HlB3vmWy6uv9VjlC9TmLWTt1ffA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)