UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E9jniygMjQIcQ/dRoD8WtKjVNPQ1n8md3F4A6DUZwUg='
WHERE
key_id = 'ee113d9b595dafc9eba122a7e5592543249bad29d7288de8c4bce3f8759e044f'
AND (
token = 'E9jniygMjQIcQ/dRoD8WtKjVNPQ1n8md3F4A6DUZwUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)