UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9C+VAPYVJiVi8kMLmz7w7LoGUQu4XYrQfDz5ujfOHOE='
WHERE
key_id = 'ece6dace62259c9cc2a6d2e3355d78554de1488157ca3d449c896e07717fdf17'
AND (
token = '9C+VAPYVJiVi8kMLmz7w7LoGUQu4XYrQfDz5ujfOHOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)