UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e1bxBxaZw5Gst4lRNV/dkvP1cbw+pTlH8+aU392nFqs='
WHERE
key_id = '9cd59d79be47d89e4edf79d1f54fd97f6e11e339e6863b7fa7b63d596a7b1644'
AND (
token = 'e1bxBxaZw5Gst4lRNV/dkvP1cbw+pTlH8+aU392nFqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)