UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ndh+E3hJgAwE15fLH12tOJO9VkwbRKWvMfD7QFdDRI0='
WHERE
key_id = '013ba037b5ba5a37a2c1d558c25d1d6be493febc4d65da1cf34a638a5f49fd89'
AND (
token = 'ndh+E3hJgAwE15fLH12tOJO9VkwbRKWvMfD7QFdDRI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)