UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5CRwhpjeAG0h4Uyp4UCp2B90zH5Y+mOSge/VkrekeBU='
WHERE
key_id = '1e5bd8b0d658eee74fee7a64a3634aa256b56f72b4830e5d2cb9fb9d5d04c481'
AND (
token = '5CRwhpjeAG0h4Uyp4UCp2B90zH5Y+mOSge/VkrekeBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)