UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PMQL4XqRkPaB76+LmKx2Cd8049C5rL7/bL60ffrTCSg='
WHERE
key_id = 'a07cafe4469afc98e55ce72710535c09077517c8aac841a799ae91f9bc1fe21e'
AND (
token = 'PMQL4XqRkPaB76+LmKx2Cd8049C5rL7/bL60ffrTCSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)