UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ENonnfVla5CqYbCC2l4pFliPj7uFhL6fEMxeb9wphKI='
WHERE
key_id = '5c67c0c5a5649164fc44bf00f50d4c7deffc659080097800f2e401c58f3c3998'
AND (
token = 'ENonnfVla5CqYbCC2l4pFliPj7uFhL6fEMxeb9wphKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)