UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZH3zD3WQcVeNBOf20WR4Iv+wELt5BPXGfUN0DqecVl8='
WHERE
key_id = '9b2c7169371becd8b14c75f8d952d04a344b2b6a95ca23093d6fe602a1355cb2'
AND (
token = 'ZH3zD3WQcVeNBOf20WR4Iv+wELt5BPXGfUN0DqecVl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)