UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5GwXAOzVqIG4glVLnrUrf+q36Twr5i9PcKup9hAlCmQ='
WHERE
key_id = '3623ecca4333af72f9c926b7b406e40239472e2a4e8edb0e5168bb5e170657e7'
AND (
token = '5GwXAOzVqIG4glVLnrUrf+q36Twr5i9PcKup9hAlCmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)