UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W9Pjg1WS6QLVW4EYUizHs6bqpt3CgZzoY2rsn4nCOOo='
WHERE
key_id = '813c200248f902e2c2a04dc148f4aeaa006cf26e6193a363050a48dd3419362a'
AND (
token = 'W9Pjg1WS6QLVW4EYUizHs6bqpt3CgZzoY2rsn4nCOOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)