UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vdMBIB29Z5xaEQnPo1QwEF/PjHQdKAGDQGRRRaKrbg='
WHERE
key_id = '32067e081d5bc1da46c41645412e6ec804df98a55e303d8ff20ed9ddff785ce4'
AND (
token = '5vdMBIB29Z5xaEQnPo1QwEF/PjHQdKAGDQGRRRaKrbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)